<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;


/**
 * App\Models\ShopAttributes
 *
 * @property int $attr_id
 * @property string|null $attr_name
 * @property int $shop_id
 * @property-read \App\Models\Shop $shop
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\ShopValues[] $values
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShopAttributes newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShopAttributes newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShopAttributes query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShopAttributes whereAttrId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShopAttributes whereAttrName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShopAttributes whereShopId($value)
 * @mixin \Eloquent
 */
class ShopAttributes extends Model
{
    protected $table = 'shop_attributes';
    protected $primaryKey = 'attr_id';
    protected $fillable = ['attr_id', 'attr_name', 'shop_id'];

    public $timestamps = false;

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function shop()
    {
        return $this->belongsTo(Shop::class, 'shop_id', 'shop_id');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function values()
    {
        return $this->hasMany(ShopValues::class, 'attr_id', 'attr_id');
    }
}
